﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		ISearchService.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System.Collections.Generic;
using Dexter.DataTransferObject;
using Dexter.Domain.Model;
using Dexter.Domain.Results;

namespace Dexter.Search {
	public interface ISearchService {
		/// <summary>
		/// /// Search the full text index by query string
		/// </summary>
		/// <param name="pageIndex">Index of the page.</param>
		/// <param name="pageSize">Size of the page.</param>
		/// <param name="text">The text.</param>
		/// <returns></returns>
		SearchResult Search ( int pageIndex, int pageSize, string text );

		/// <summary>
		/// Retrieve a set of related <see cref="Item"/> for the specified element.
		/// </summary>
		/// <param name="itemId">The item id.</param>
		/// <param name="pageIndex">Index of the page.</param>
		/// <param name="pageSize">Size of the page.</param>
		/// <returns></returns>
		IPagedResult<SearchItem> ReleatedPost ( int itemId, int pageIndex, int pageSize );

		/// <summary>
		/// Indexes the specified items.
		/// </summary>
		/// <param name="items">The items.</param>
		void IndexItems (IEnumerable<Item> items);

		/// <summary>
		/// Indexes the specified <see cref="Item"/>.
		/// </summary>
		/// <param name="item">The item.</param>
		void IndexItem ( Item item );
		
		/// <summary>
		/// Removes the specified <see cref="Item"/> from the search index.
		/// </summary>
		/// <param name="item">The item.</param>
		void RemoveItem ( Item item );

		/// <summary>
		/// Gets the number of <see cref="Item"/> indexed.
		/// </summary>
		/// <returns></returns>
		int GetIndexedItemsCount ();
	}
}
